<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Checkout</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="images/favicon.png"/>
    <link href="https://fonts.googleapis.com/css?family=Montserrat:300,300i,400,400i,500,500i,600,600i,700,700i&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Lato:300,300i,400,400i,700,700i&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/owl.carousel.min.css">
    <link rel="stylesheet" href="css/animate.min.css">
    <link rel="stylesheet" href="css/jquery-ui.css">
    <link rel="stylesheet" href="css/slick.css">
    <link rel="stylesheet" href="css/chosen.min.css">
    <link rel="stylesheet" href="css/pe-icon-7-stroke.css">
    <link rel="stylesheet" href="css/magnific-popup.min.css">
    <link rel="stylesheet" href="css/lightbox.min.css">
    <link rel="stylesheet" href="js/fancybox/source/jquery.fancybox.css">
    <link rel="stylesheet" href="css/jquery.scrollbar.min.css">
    <link rel="stylesheet" href="css/mobile-menu.css">
    <link rel="stylesheet" href="fonts/flaticon/flaticon.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="admin/layui/css/layui.css">
</head>
<body class="inblog-page">

<div class="main-content main-content-checkout">
    <div class="container">
      
        <div class="checkout-wrapp">
            
            
            <div class="end-checkout-wrapp">
                <div class="end-checkout checkout-form">
                    
                   
                    <div class="sub-title" id="order">
						
                    </div>
                    <a onclick="zfb()" class="button btn-return">点击扫码支付</a>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 引入页脚栏 -->
	<jsp:include page="footer.jsp"></jsp:include>
<script src="js/jquery-1.12.4.min.js"></script>
<script src="js/jquery.plugin-countdown.min.js"></script>
<script src="js/jquery-countdown.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/magnific-popup.min.js"></script>
<script src="js/isotope.min.js"></script>
<script src="js/jquery.scrollbar.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/mobile-menu.js"></script>
<script src="js/chosen.min.js"></script>
<script src="js/slick.js"></script>
<script src="js/jquery.elevateZoom.min.js"></script>
<script src="js/jquery.actual.min.js"></script>
<script src="js/fancybox/source/jquery.fancybox.js"></script>
<script src="js/lightbox.min.js"></script>
<script src="js/owl.thumbs.min.js"></script>
<script src="js/jquery.scrollbar.min.js"></script>
<script src='https://ditu.google.cn/maps/api/js?key=AIzaSyC3nDHy1dARR-Pa_2jjPCjvsOR4bcILYsM'></script>
<script src="js/frontend-plugin.js"></script>
<script src="admin/layui/layui.js"></script>
<script type="text/javascript">
var layer;
layui.use('layer', function(){
	layer = layui.layer;
});

$.post("http://localhost:8080/Greenleaf/order/address",
		{"adsId" : '${param.adsId}',
		"ids" : '${param.ids}',
		"total" : '${param.total}'
		},
		function(res) {
		  if (res) {
			  layer.msg('添加成功');
			  document.getElementById("order").innerHTML='';
			  var html='';
			  if(res.address!=null){
				  var address=res.address.provice+'-'+res.address.city+'-'+res.address.county+'-'+address
				  html+='收货人：<span id="name">'+res.address.consignee+'</span><br><br>'
						+'	手机号：<span id="phone">'+res.address.phone+'</span><br><br>'
						+'	收获地址：<span id="address">'+address+'</span><br><br>';
			  }else{
				  html +='	<h3>地址信息错误，请重新下单</h3>';
			  }
			  if(res.order!=null){
				 html +='	 订单号：<span id="number">'+res.order.orderNumber+'</span><br><br>'
					+'	 订单创建时间：<span id="stime">'+res.order.orderTime+'</span><br><br>'
					+'	  订单总金额：<span id="unit">'+res.order.total+'</span>元<br>';
			  }else{
				 html +='	<h3>订单信息错误，请重新下单</h3>';
			  }
				document.getElementById("order").innerHTML=html;
		} else {
			 layer.msg('添加失败');
			 return false;
		}
	}, "json");
	
	function zfb(){
		var orderNumber=document.getElementById("number").innerHTML;
			$.post("http://localhost:8080/Greenleaf/order/getForm",
					{ "orderNumber" : orderNumber },
					function(res) {
						 $("html").html(res.form);
				}, "json");
	}
</script>
</body>
</html>